package com.happy.xiao.common.listener;

import com.happy.xiao.common.listener.event.PushOrderRecordEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * 这是一个监听器， 相当于rabbitmq的监听器
 *
 * event 绑定一个listener   -> 一个event 可以绑定多个listener
 *
 */
@Component
public class PushOrderRecordListener implements ApplicationListener<PushOrderRecordEvent> {


    @Override
    public void onApplicationEvent(PushOrderRecordEvent pushOrderRecordEvent) {

        System.out.println(pushOrderRecordEvent.getOrderNo());
        System.out.println(pushOrderRecordEvent.getOrderType());

    }
}
